Harden Vast runtime with seeded auth login#8
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe Vast runtime connection implementation has been enhanced to provision and manage PitchServer authentication tokens. Functions Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Motivation
uvicornbound to0.0.0.0without authentication, allowing unauthenticated access to/scoreand/health.vastmode, so public instances could be abused remotely.Description
PITCHSERVER_AUTH_REQUIRED=1,PITCHSERVER_AUTH_SEED_USERNAME,PITCHSERVER_AUTH_SEED_PASSWORD, andPITCHSERVER_SESSION_TTL_SECONDSinto the instanceenvduring creation insrc-tauri/src/lib.rs.vast_auth_credentialsto derive a seeded username/password from configuredRuntimeConfigor generate a time-based fallback password, and thread those credentials intocreate_vast_instanceandwait_for_vast_runtimecalls.login_pitch_server) and return the resulting bearer token from the Vast connect flow; persist that token in app state viastore_pitch_server_auth_tokenso the desktop can reuse it.vastmode as well (score_pitchnow addsAuthorization: Bearer <token>whenstatus.mode == "vast").Testing
cargo fmt --manifest-path src-tauri/Cargo.tomlwhich completed successfully.cargo check --manifest-path src-tauri/Cargo.tomlwhich could not finish in this environment because the systemglib-2.0/pkg-configdependency is missing; the failure is an external system dependency, not a logical error in the changed code.Codex Task
Summary by CodeRabbit
Release Notes